/*
 * Copyright (c) 2015. For Intelligent Group.
 */

package com.intelligent.ispc.export;

import com.google.common.collect.Lists;
import com.intelligent.ispc.core.dto.TestItemDto;
import com.intelligent.ispc.foundation.pdf.ExPdfPage;
import com.intelligent.ispc.foundation.pdf.ExPdfPageFactory;
import com.intelligent.ispc.r.dto.NormalDistributionDto;
import com.intelligent.ispc.r.dto.RuleResultDto;
import com.itextpdf.text.Element;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.PdfPTable;

import java.util.List;
import java.util.Map;

/**
 * Created by cherry on 2016/8/12.
 */
public class ExportPdfPageFactory implements ExPdfPageFactory {

    private List<ExPdfPage> exPdfPages = Lists.newArrayList();

    public void buildSPC4SingleItem(Map<String, Object> searchParams, Map<String, Object> results) {
        ExPdfPage pdfPage = new ExPdfPage();
        Paragraph paragraph = new Paragraph("charts");
        paragraph.setAlignment(Element.ALIGN_CENTER);
        pdfPage.setPageTitle(paragraph);
        List<PdfPTable> tables = Lists.newArrayList();
        pdfPage.setTables(tables);
    }

    public void buildSPCMultiItems(Map<String, Object> searchParam, Map<String, Object> resultData, Map<String, Object> testItems) {

    }

    public PdfPTable headTable(Map<String, Object> searchParams) {
        PdfPTable pdfPTable = new PdfPTable(2);
        return pdfPTable;
    }

    public PdfPTable buildNDC(NormalDistributionDto dto, String filePath) {
        PdfPTable pdfPTable = new PdfPTable(3);
        return pdfPTable;
    }

    public PdfPTable buildRuleDescription(Map<String, Object> results) {
        PdfPTable pdfPTable = new PdfPTable(2);
        return pdfPTable;
    }

    public PdfPTable buildRC(List<RuleResultDto> ruleResultList, String filePath, String rcharName) {
        PdfPTable pdfPTable = new PdfPTable(3);
        return pdfPTable;
    }

    public PdfPTable buildItemDatas(List<TestItemDto> dtos, double[] mrValue, String[] xxbarValue) {
        PdfPTable pdfPTable = new PdfPTable(3);
        return pdfPTable;
    }

    @Override
    public List<ExPdfPage> getPdfPages() {
        return exPdfPages;
    }

    public void setExPdfPages(List<ExPdfPage> exPdfPages) {
        this.exPdfPages = exPdfPages;
    }
}
